package cc.vv.btpartyjob.partyservice.delegate

import android.widget.TextView
import cc.vv.baselibrary.view.BaseTopBarView
import cc.vv.btpartyjob.partyservice.R
import cc.vv.mvp.delegate.BaseAppDelegate

/**
 * 认领别人发布的微捐赠托管类
 * Created by Chen.qi on 2018/10/27.
 */
class ClaimDonateActivityDelegate : BaseAppDelegate() {

    override fun initWidget() {

    }

    override fun initLayoutRes(): Int {
        return R.layout.activity_claim_wish
    }

    /**设置标题title*/
    fun setTopBarTitle(topBarTitle: String) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_cwdD_topBar)
        titleBar?.setTitle(topBarTitle)
    }


    /**设置标题右边按钮点击事件*/
    fun setTitleBackBtnOnClick(event: BaseTopBarView.EventInterface) {
        val titleBar = getView<BaseTopBarView>(R.id.btv_cwdD_topBar)
        titleBar?.setEventInterface(event)
    }

    /**
     * 获取name
     */
    fun getName(): String {
        val viewName = getView<TextView>(R.id.et_cwdD_inputName)
        return viewName?.text.toString().trim()
    }

    /**
     * 获取电话
     */
    fun getMobile(): String {
        val viewMobile = getView<TextView>(R.id.et_cwdD_inputTelPhone)
        return viewMobile?.text.toString().trim()
    }


    /**
     * 获取备注
     */
    fun getRemark(): String {
        val viewContent = getView<TextView>(R.id.et_cwdD_inputRemark)
        return viewContent?.text.toString().trim()
    }

    /**
     * 设置创建时间
     */
    fun setCretatTime(time: String?) {
        getView<TextView>(R.id.et_cwdD_createTime)?.text = time
    }

    /**
     * 设置内容
     */
    fun setContent(content: String?) {
        getView<TextView>(R.id.tv_cwdD_content)?.text = content
    }

    /**
     * 设置许愿人
     */
    fun setPerson(personName: String?) {
        getView<TextView>(R.id.tv_cwdD_xyPer)?.text = personName
    }


}